﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
    StorageMonthOutSearchEvent event = (StorageMonthOutSearchEvent)context.getSessionValue("StorageMonthOutSearchEvent");
    ObjectList list = StorageMonthOut.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<%@page import="system.base.StorageMonthOutSrv"%>
<%@page import="java.util.Vector"%>
<%@page import="system.data.StorageMonthOutPageData"%>
<%@page import="java.util.Map"%>
<script language=javascript>

var list_code = "listStorageMonthOut";

function doSearch()
{

    //SetValue("s_Id",GetValue("i_Id")); //id主键
    //SetValue("s_CategoryCode",GetValue("i_CategoryCode")); //产品分类编码
    //SetValue("s_ProductMoney",GetValue("i_ProductMoney")); //产品金额总计
    //SetValue("s_OrderField",GetValue("i_OrderField")); //排序
    //SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
    SetValue("s_WarehouseCode",GetValue("i_WarehouseCode")); //仓库编码
    SetValue("s_BalanceTime",GetValue("i_Year")); //结算时间
    doCommonSearch();
}

function bizViewStorageMonthOut(id)
{
    viewWin("<%=Config.getSrv()%>?action_code=viewStorageMonthOut&Id="+id);
}

function doDelete()
{
    if(!hasChooseRadio("ids"))
    {
        bizMessage("删除","出库月结表");
        return false;
    }
    if(!bizConfirm("删除","出库月结表")) return false;
    SetAction("deleteStorageMonthOut");
    frm.submit();
}

function doToAdd()
{
    SetAction("toAddStorageMonthOut");
    frm.submit();
}

function doToUpdate()
{
    if(!checkOne("ids")) 
    {
        bizMessage("修改","出库月结表");
        return false;
    }
    SetValue("Id",getCheckBoxValue("ids"));
    SetAction("toUpdateStorageMonthOut");
    frm.submit();
}
function doToCopy()
{
    if(!checkOne("ids")) 
    {
        bizMessage("复制","出库月结表");
        return false;
    }
    SetValue("Id",getCheckBoxValue("ids"));
    SetAction("toCopyStorageMonthOut");
    frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>








<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域--> 


<%
String time = event.getBalanceTime();
String year = time.substring(0,4);
%>
<input type=hidden name="s_WarehouseCode" value="<%=event.getWarehouseCode()%>"> <!--仓库编码-->
<input type=hidden name="s_BalanceTime" value="<%=event.getBalanceTime()%>"> <!--结算时间-->
<input type=hidden name="year" value="<%=year%>"> <!--结算时间-->

<%@ include file="/framework/list_head.jsp"%>


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

    <%=uiSearchInputTR%>>
        <%=uiSearchInputTDHead%>>
            仓库选择：
        </td>
        <%=uiSearchInputTDHead%>>
            <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode",event.getWarehouseCode(),false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        </td>       
    </tr>
    
    <%=uiSearchInputTR%>>
        <%=uiSearchInputTDHead%>>
            选择结算年份：
        </td>
        <%=uiSearchInputTDHead%>>
            <%=SelectManager.viewYearSelect(con,"i_Year",year,false,"","-请选择-","","")%>  
            <input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
        </td>       
    </tr>    

<%=uiSearchEnd%>

<!--列表标题-->
<%
boolean isfirst = false; 
if(String.valueOf(context.getSessionValue("isfirst")) == "true"){
    isfirst = true;
}
%>
<%if(isfirst || year == null || year.equals("0000") || year.equals("")){%>
    <%=UIManager.addListHeadTitle("单一公司年材料费用分类月线")%>    
<%}else{%>
    <%=UIManager.addListHeadTitle(Warehouse.getNameByCode(con,event.getWarehouseCode())+"公司"+year+"年材料费用分类月线")%>
<%}%>

<!--********************* Part6:List Area ***************-->
<%=uiListStart%>>
<%
    String menu = (String)context.getSessionValue("choice");
    Vector vec = (Vector)context.getSessionValue(menu);
    //String[] warehouseNames = null;
    //String money = "";
    if(!isfirst && vec != null && vec.size() > 0){%>
    <script language=javascript>
function drawReplication(total,table_x,table_y,all_width,all_height,line_no)
    {
//参数含义(传递的数组，横坐标，纵坐标，图表的宽度，图表的高度,折线条数)
//纯ASP代码生成图表函数2——折线图
//作者：龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
//本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
//版本1.0 最后修改日期 2003-8-11
//非常感谢您使用这个函数，请您使用和转载时保留版权信息，这是对作者工作的最好的尊重。
//***************************************************************************************
//修改说明：
//    本代码经原作者同意，由 awaysrain（绝对零度）修改为javascript。
//    最后修改日期 2003-9-22，测试环境为IE 6.0.2500.1106
//    因本人水平有限，修改中难免有错误，请大家及时指正。  
//***************************************************************************************
var line_color = "#69f";
var left_width = 70;
var total_no = total[1].length;
var temp1,temp3,temp4;

temp1 = 0;
for(var i=1;i<total_no;i++)
{
 for(var j=1;j<=line_no;j++)
 {
  if(temp1<total[j][i])
   temp1 = total[j][i];
 }
}
temp3 = temp1;
temp4 = temp3;
document.write("<v:rect id='_x0000_s1027' alt='' style='position:absolute;left:" + (table_x + left_width) + "px;top:" + table_y + "px;width:" + all_width + "px;height:" + all_height + "px;z-index:-1' fillcolor='#9cf' stroked='f'><v:fill rotate='t' angle='-45' focus='100%' type='gradient'/></v:rect>");
for(var i=0;i<all_height;i += all_height/5)
{
 document.write("<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x + left_width + length) + "px," + (table_y + all_height - length - i) + "px' to='" + (table_x + all_width + left_width) + "px," + (table_y + all_height - length - i) + "px' strokecolor='" + line_color + "'/>");
 document.write("<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x + (left_width - 15)) + "px," + (table_y + i) + "px' to='" + (table_x + left_width) + "px," + (table_y + i) + "px'/>");
 document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + table_x + "px;top:" + (table_y + i) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
 document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + temp4 + "</td></tr></table></v:textbox></v:shape>");
 temp4 = temp4 - temp3/5;
 temp4 = Math.round(temp4*100)/100;
}
document.write("<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x + left_width) + "px," + (table_y + all_height) + "px' to='" + (table_x + all_width + left_width) + "px," + (table_y + all_height) + "px'/>");
document.write("<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x + left_width) + "px," + table_y + "px' to='" + (table_x + left_width) + "px," + (table_y + all_height) + "px'/>");
var tmpStr = ""
for(i=1;i<=line_no;i++)
{
 var re  = /,/g;
 tmpStr += ",[\"" + total[i][0].replace(re,"\",\"") + "\"]"
}
tmpStr = tmpStr.substr(1,tmpStr.length-1)
var line_code = eval("new Array(" + tmpStr + ")")
for(var j=1;j<=line_no;j++)
{
 for(var i=1;i<total_no-1;i++)
 {
  var x1 = table_x + left_width + all_width * (i - 1)/(total_no-1)
  var y1 = table_y + (temp3 - total[j][i]) * (all_height/temp3)
  var x2 = table_x + left_width + all_width * i/(total_no-1)
  var y2 = table_y + (temp3 - total[j][i+1]) * (all_height/temp3)
  
  document.write("<v:line id='_x0000_s1025' alt='' style='position:absolute;left:0;text-align:left;top:0;z-index:1' from='" + x1 + "px," + y1 + "px' to='" + x2 + "px," + y2 + "px' coordsize='21600,21600' strokecolor='" + line_code[j-1][0] + "' strokeweight='" + line_code[j-1][1] + "'>");
  switch (parseInt(line_code[j-1][2]))
  {
   case 1:
    break;
   case 2:
    document.write("<v:stroke dashstyle='1 1'/>");
    break;
   case 3:
    document.write("<v:stroke dashstyle='dash'/>");
    break;
   case 4:
    document.write("<v:stroke dashstyle='dashDot'/>");
    break;
   case 5:
    document.write("<v:stroke dashstyle='longDash'/>");
    break;
   case 6:
    document.write("<v:stroke dashstyle='longDashDot'/>");
    break;
   case 7:
    document.write("<v:stroke dashstyle='longDashDotDot'/>");
    break;
  }
  
  document.write("</v:line>");
  
  switch (parseInt(line_code[j-1][3]))
  {
   case 1:
    break;
   case 2:
    document.write("<v:rect id='_x0000_s1027' style='position:absolute;left:" + (x1 - 2) + "px;top:" + (y1 - 2) + "px;width:4px;height:4px; z-index:2' fillcolor='" + line_code[j-1][0] + "' strokecolor='" + line_code[j-1][0] + "'/>");
    break;
   case 3:
    document.write("<v:oval id='_x0000_s1026' style='position:absolute;left:" + (x1 - 2) + "px;top:" + (y1 - 2) + "px;width:4px;height:4px;z-index:1' fillcolor='" + line_code[j-1][0] + "' strokecolor='" + line_code[j-1][0] + "'/>");
    break;
  } 
  
 }
  switch (parseInt(line_code[j-1][3]))
  {
   case 1:
    break;
   case 2:
    document.write("<v:rect id='_x0000_s1027' style='position:absolute;left:" + (x2 - 2) + "px;top:" + (y2 - 2) + "px;width:4px;height:4px; z-index:2' fillcolor='" + line_code[j-1][0] + "' strokecolor='" + line_code[j-1][0] + "'/>");
    break;
   case 3:
    document.write("<v:oval id='_x0000_s1026' style='position:absolute;left:" + (x2 - 2) + "px;top:" + (y2 - 2) + "px;width:4px;height:4px;z-index:1' fillcolor='" + line_code[j-1][0] + "' strokecolor='" + line_code[j-1][0] + "'/>");
    break;
  }
}
 
for(var i=0;i<total_no-1;i++)
{
 document.write("<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x + left_width + all_width * (i)/(total_no-1)) + "px," + (table_y + all_height) + "px' to='" + (table_x + left_width + all_width * (i)/(total_no-1)) + "px," + (table_y + all_height + 15) + "px'/>");
 document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x + left_width + all_width * (i)/(total_no-1)) + "px;top:" + (table_y + all_height) + "px;width:" + (all_width/(total_no-1)) + "px;height:18px;z-index:1'>");
 document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");
}
var tb_height = 30
document.write("<v:rect id='_x0000_s1025' style='position:absolute;left:" + (table_x + all_width + 20) + "px;top:" + table_y + "px;width:100px;height:" + (line_no * tb_height + 20) + "px;z-index:1'/>");
for(var i=0;i<line_no;i++)
{
 document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x + all_width + 25) + "px;top:" + (table_y + 10+(i) * tb_height) + "px;width:60px;height:" + tb_height + "px;z-index:1'>");
 document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>" + line_code[i][4] + "</td></tr></table></v:textbox></v:shape>");
 document.write("<v:rect id='_x0000_s1040' alt='' style='position:absolute;left:" + (table_x + all_width + 80) + "px;top:" + (table_y + 10+(i) * tb_height + 4) + "px;width:30px;height:20px;z-index:1' fillcolor='" + line_code[i][0] + "'><v:fill color2='" + line_code[i][0] + "' rotate='t' focus='100%' type='gradient'/></v:rect>");
}
}
</script>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:*         { behavior: url(#default#VML) }
o\:*         { behavior: url(#default#VML) }
.shape       { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>

<script language=javascript>
var nameArray = new Array();
nameArray[0]="一月";
nameArray[1]="二月";
nameArray[2]="三月";
nameArray[3]="四月";
nameArray[4]="五月";
nameArray[5]="六月";
nameArray[6]="七月";
nameArray[7]="八月";
nameArray[8]="九月";
nameArray[9]="十月";
nameArray[10]="十一月";
nameArray[11]="十二月";
<%
String[] colors = new String[]{"#990000","#9999FF","#66FFCC","#CC66CC","#FF9999","#999999","#CCFF66","#003366","#FFFF00","#6600FF",
        "#CCCCFF","#D40000","#FF0000"};   
//参数1线条的颜色，参数2线条的宽度，参数3线条的类型，参数4转折点的类型,参数5线条名称
int lineCount =  vec.size();
for(int count = 0;count < lineCount;count++){
    Map map = (Map)vec.get(count);
    String cateName = (String)map.get("cate");
    String[] values = (String[])map.get("value");
    out.println("var dataArray"+count+" = new Array()");
    out.println("dataArray"+count+"[0] = \""+colors[count]+",1,1,3,类型:"+cateName+"\"");%>
    <%out.println("dataArray"+count+"[1] = "+values[0]);%>
    <%out.println("dataArray"+count+"[2] = "+values[1]);%>
    <%out.println("dataArray"+count+"[3] = "+values[2]);%>
    <%out.println("dataArray"+count+"[4] = "+values[3]);%>
    <%out.println("dataArray"+count+"[5] = "+values[4]);%>
    <%out.println("dataArray"+count+"[6] = "+values[5]);%>
    <%out.println("dataArray"+count+"[7] = "+values[6]);%>
    <%out.println("dataArray"+count+"[8] = "+values[7]);%>
    <%out.println("dataArray"+count+"[9] = "+values[8]);%>
    <%out.println("dataArray"+count+"[10] = "+values[9]);%>
    <%out.println("dataArray"+count+"[11] = "+values[10]);%>
    <%out.println("dataArray"+count+"[12] = "+values[11]);%>
<%}%>
<%for(int count = 0;count < lineCount;count++){
    if(lineCount == 1){
        out.println("var total = new Array(nameArray,dataArray0");        
    }else{
        if(count == 0){
            out.println("var total = new Array(nameArray,dataArray"+count+",");
        }else if(count != lineCount - 1){
            out.print("dataArray"+count+",");
        }else{
            out.print("dataArray"+count+")");
        }
    }
}%>
drawReplication(total,70,150,600,250,3);
</script>
</body>
</html>



<%}%>
<%=uiListEnd%>
</form>
<%@ include file="/framework/foot.jsp"%>
<!--
    Author    :Benny
    FileName  :/system/base/StorageMonthOutList5001.jsp
-->
